<script src="/static/distpicker.min.js"></script>
<form class="form-horizontal" method="post" id="editForm" action="{:request()->url()}">

                    <div class="form-group">
                        <label class="col-sm-2">名称：</label>
                        <div class="col-sm-4">
                            <input type="text" class="form-control" name="company" placeholder="">
                        </div>
                        <label class="col-sm-2">手机：</label>
                        <div class="col-sm-4">
                            <input type="text" class="form-control" name="mobile" placeholder="">
                        </div>
                    </div>
                    <div class="form-group">
                        <label class="col-sm-2">微信：</label>
                        <div class="col-sm-4">
                            <input type="text" class="form-control" name="weixin" placeholder="">
                        </div>
                        <label class="col-sm-2">电话2：</label>
                        <div class="col-sm-4">
                            <input type="text" class="form-control" name="mobile2" placeholder="">
                        </div>
                    </div>
                    <div class="form-group">
                        <label class="col-sm-2">照片：</label>
                        <div class="col-sm-10">
                            <{tmdTag:upimgmember name="photo"/}>
                        </div>
                    </div>
                    <div class="form-group">
                        <label class="col-sm-2">类型：</label>
                        <div class="col-sm-4">
                            <{tmdTag:select name="type" optname="customer_type" /}>
                        </div>
                        <label class="col-sm-2">来源：</label>
                        <div class="col-sm-4">
                            <{tmdTag:select name="comefrom" optname="customer_comefrom" /}>
                        </div>
                    </div>
                    <div class="form-group">
                        <label class="col-sm-2">状态：</label>
                        <div class="col-sm-4">
                            <{tmdTag:select name="status" optname="customer_status" /}>
                        </div>
                        <label class="col-sm-2">回访时间：</label>
                        <div class="col-sm-4">
                            <{tmdTag:date name="retime"/}>
                        </div>
                    </div>
                    <div class="form-group">
                        <label class="col-sm-2"> 地址：</label>
                        <div class="col-sm-4">
                            <div class="pure-g" data-toggle="distpicker">
                                <select class="form-control sm-1-2" name="province"
                                        data-province="<?= $editData['province'] ?: '' ?>">
                                </select>
                                <select class="form-control sm-1-2" name="city"
                                        data-city="<?= $editData['city'] ?: '' ?>">
                                </select>
                            </div>
                        </div>
                        <div class="col-sm-6">
                            <input type="text" class="form-control" name="address" placeholder="详细地址">
                        </div>
                    </div>
                    <div class="form-group">
                        <label class="col-sm-2"> 坐标：</label>
                        <div class="col-sm-10">
                            <{tmdTag:map namej='map_lng' namew='map_lat' /}>
                        </div>
                    </div>
                    <div class="form-group">
                        <label class="col-sm-2">业务员：</label>
                        <div class="col-sm-4">
                            <?php $m= session('member');$request = \think\Request::instance();?>
                            <select name="sales" class="mySelect" style="width: 100%" <?php if($m['type']=='1' and $request->action()=='edit' or $m['type']=='2' and $request->action()=='edit'){echo "disabled";}?>>
                                <option value=""></option>
                                <?=\app\member\model\Member::option()?>
                            </select>
                        </div>
                        <label class="col-sm-2">客服：</label>
                        <div class="col-sm-4">
                            <select name="service" class="mySelect" style="width: 100%" <?php if($m['type']=='1' and $request->action()=='edit' or $m['type']=='2' and $request->action()=='edit'){echo "disabled";}?>>
                                <option value=""></option>
                                <?=\app\member\model\Member::option()?>
                            </select>
                        </div>
                    </div>
                    <div class="form-group">
                        <label class="col-sm-2">备注：</label>
                        <div class="col-sm-10">
                            <textarea name="remark" rows="5" style="width:100%" class="form-control" placeholder="店铺大小/负责人/开业时间/店铺规模等"></textarea>
                        </div>
                    </div>
                    <div class="form-group">
                        <div class="col-sm-offset-2 col-sm-10">
                            <input type="hidden" class="form-control" name="id">
                            <button type="submit" class="btn btn-primary">保存</button>
                        </div>
                    </div>

                </form>


<script>
    $('#editForm').myForm();
    
    // <?php if ($editData) { ?> //
    var editData = <?=json_encode($editData, JSON_UNESCAPED_UNICODE)?>;
    $('#editForm').myFormData(editData);
    // <?php } ?> //

</script>
<script>pageInit();</script>